package com.cloud.class05.config;

import org.springframework.cloud.client.loadbalancer.LoadBalanced;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.web.client.RestTemplate;

/**
 * @ClassDescription:
 * @JdkVersion: 17
 * @Author: yxy
 * @Created: 2024/4/10 10:32
 */
@Configuration
public class RestTemplateConfig {
    @Bean //@Bean的作用是将一个方法返回的对象放到spring容器中
    @LoadBalanced //@LoadBalanced作用是开启负载均衡
    public RestTemplate restTemplate() {
        return new RestTemplate();
    }
}
